<template>
  <el-form :model="form" ref="forgetForm">
    <el-form-item>
      <el-input v-model="form.email" placeholder="请输入注册邮箱">
        <template #prefix>
          <el-icon><Message /></el-icon>
        </template>
      </el-input>
    </el-form-item>

    <el-form-item>
      <el-button type="primary" @click="submitForm" :loading="loading">
        发送重置链接
      </el-button>
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  name: 'ForgetPasswordForm',
  emits: ['success'],
  data() {
    return {
      form: {
        email: ''
      },
      loading: false
    }
  },
  methods: {
    async submitForm() {
      this.loading = true
      try {
        // 这里调用API发送重置邮件
        this.$emit('success')
      } finally {
        this.loading = false
      }
    }
  }
}
</script>
